package com.herui.ota.service;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.herui.ota.entity.FileSrc;
import org.shan.base.layer.user.service.IBaseService;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * author name: amanda.shan
 * create time: 2023-10-26 13:19:07
 */ 
public interface FileSrcService extends IBaseService<FileSrc> {

    /**
     * 下载文件
     * @param path
     * @param request
     * @param response
     * @throws IOException
     */
    void download(String path, Integer skip, HttpServletRequest request, HttpServletResponse response) throws IOException;

    /**
     * 下载base64文件
     * @param path
     * @return
     */
    String download(String path) throws IOException;


    /**
     * 上传文件
     * @param filename
     * @param file
     */
    String upload(String filename, MultipartFile file);

    /**
     * 开始文件传输
     * @param filename
     * @return
     */
    int start(String filename);

    /**
     * 结束文件传输
     * @param taskId
     */
    void end(Integer taskId);

}

